interface IIPhone {
}
interface IIPad {
}



class IPhone13 implements IIPhone {
  constructor() {
    console.log('IPhone13');
  }
}
class IPhone13pro implements IIPhone {
  constructor() {
    console.log('IPhone13pro');
  }
}

class IPad8 implements IIPad {
  constructor() {
    console.log('IPad8');
  }
}
class IPad8pro implements IIPad {
  constructor() {
    console.log('IPad8pro');
  }
}


interface IFushikang {
  makeIIPhone: () => IIPhone // 生产iphone
  makeIIPad(): IIPad    // 生产ipad
}

class ZhengzhouFushikang implements IFushikang {
  constructor() {
    console.log('郑州富士康造');
  }
  makeIIPhone() {

    return new IPhone13pro()
  }

  makeIIPad(): IIPad {
    return new IPad8()
  }
}

class ShenzhenFushikang implements IFushikang {
  constructor() {
    console.log('深圳富士康造');
  }
  makeIIPhone() {
    return new IPhone13()
  }

  makeIIPad(): IIPad {
    return new IPad8pro()
  }
}

const zz = new ZhengzhouFushikang()
zz.makeIIPad()
zz.makeIIPhone()

const sz = new ShenzhenFushikang()
sz.makeIIPad()
sz.makeIIPhone()

